package com.atguigu.gmall.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author atguigu-mqx
 * @Description TODO
 * @Date 2023/5/22 9:14
 * @Version 1.0
 */
@Controller
public class PassportController {

    //  'http://passport.gmall.com/login.html?originUrl='+window.location.href
    //  http://passport.gmall.com/login.html?originUrl=http://www.gmall.com/
    @GetMapping("login.html")
    public String login(HttpServletRequest request){
        //  需要知道登录成功之后，跳转到哪里！
        request.setAttribute("originUrl",request.getParameter("originUrl"));
        //  返回登录页面
        return "login";
    }
}
